<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>close me</title>
</head>
<body>
<button onclick="go()">CLOSE</button>
<script>
  console.log("userAgent:" + navigator.userAgent);

  function go() {
    console.log("begin");
    let userAgent = navigator.userAgent;
    console.log("userAgent:" + userAgent);
    if (userAgent.indexOf("Firefox") !== -1 || userAgent.indexOf("Presto") !== -1) {
      window.location.replace("about:blank");
    }
    else {
      window.opener = null;
      window.open("", "_self");
      window.close();
    }
  }
</script>
</body>
</html>
